import { createApp } from 'vue'
import App from '@/App.vue'
// import Vue from 'vue'
import zhLocale from 'element-plus/es/locale/lang/zh-cn'

import router from './router'
import {createPinia} from 'pinia'
const pinia = createPinia()
//引入持久化插件
import piniaPluginPersistedstate from "pinia-plugin-persistedstate"
//使用持久化插件
pinia.use(piniaPluginPersistedstate)
//全局组件
// import LeftMenu from '@/components/LeftMenu.vue';
// Vue.component(LeftMenu.name, LeftMenu);
/*const app = createApp(App);
import LeftMenu from '@/components/LeftMenu.vue';
app.component("LeftMenu", LeftMenu);*/

// 定义全局变量和方法
/*const app = createApp({})
app.config.globalProperties.$getNum =0
noticeApi.informTotal().then(result => {
	app.config.globalProperties.$getNum = result.data
})
app.config.globalProperties.globalMethod = function () {
	noticeApi.informTotal().then(result => {
		app.config.globalProperties.$getNum = result.data
	})
}*/

import ElementPlus from 'element-plus' //导入element-plus
import 'element-plus/dist/index.css'
import {noticeApi} from "@/api/notice.js"; //导入element-plus样式

createApp(App).use(router).use(pinia).use(ElementPlus, { locale: zhLocale }).mount('#app')
		// .component("LeftMenu", LeftMenu)

